<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{if isset($data.seo_title) && $data.seo_title !==''}{$data.seo_title}{elseif isset($data_seo.seo_title) &&  $data_seo.seo_title !==''/}{$data_seo.seo_title}{else /}{/if}</title>
    <meta charset="UTF-8" name="keywords" content="{if isset($data.seo_keywords) && $data.seo_keywords !==''}{$data.seo_keywords}{elseif isset($data_seo.seo_keywords) &&  $data_seo.seo_keywords !==''}{$data_seo.seo_keywords}{else /}{/if}">
    <meta charst="UTF-8" name="description" content="{if isset($data.seo_description) && $data.seo_description !==''}{$data.seo_description}{elseif isset($data_seo.seo_description) &&  $data_seo.seo_description !==''}{$data_seo.seo_description}{else /}{/if}">
    <link rel="stylesheet" type="text/css" href="/static/home/css/main.css">
    <link rel="stylesheet" type="text/css" href="/static/home/css/alert.css">
    <link rel="stylesheet" type="text/css" href="/static/home/css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="/static/home/css/animate.min.css">
</head>
<body>
    <div class="header">
        <div class="top-top">
            <div class="tt-left"><div class="js-box box"></div><p>对新人的选择</p> </div>
            <div class="tt-right">
                <a href="#" class="a1">{if isset($data_ext.tell)}{$data_ext.tell}{/if}&nbsp&nbsp&nbsp&nbsp/</a>
                <a target="_blank" href="{if isset($data_ext.service_link)}{$data_ext.service_link}{/if}" class="a2">获取报价&nbsp&nbsp&nbsp&nbsp/</a>
                <a href="{if isset($data_ext.xlwb)}{$data_ext.xlwb}{/if}" target="_blank" class="a3"></a>
                <a href="#" class="a4">  <img src="{if isset($data_ext.wx_code)}{$data_ext.wx_code}{/if}" alt=""></a>
            </div>
        </div>
        <div class="top-nav">
            <div class="tn-content">
                <ul>
                    <li>
                        <a href="/" class="tn-n ">
                            <div class="xs">首页</div>
                            <div class="yc">HOME</div>
                        </a>
                    </li>
                    <li>
                        <a href="/guest" class="tn-n cur">
                            <div class="xs">客照</div>
                            <div class="yc">GUEST</div>
                        </a>
                    </li>
                    <li>
                        <a href="/works" class="tn-n">
                            <div class="xs">作品</div>
                            <div class="yc">WORKS</div>
                        </a>
                    </li>
                    <li class="psjd">
                        <a href="/venues" class="tn-n">
                            <div class="xs">拍摄基地</div>
                            <div class="yc">VENUES</div>
                        </a>
                        <div class="cgslt">
                            {volist name="data_cg" id="v"}
                            <div class="ylt shuiy-box">
                                <a target="_blank"  href="/venues/nr/id/{$v.id}"class="move-bg"> <img src="{$v.main_img}" alt="">
                                </a>
                            </div>
                            {/volist}

                        </div>
                    </li>
                    <li>
                        <a href="/tripshoot" class="tn-n">
                            <div class="xs">全球旅拍</div>
                            <div class="yc">TRIP SHOOT</div>
                        </a>
                    </li>
                    <li>
                        <a href="/artclub" class="tn-n">
                            <div class="xs">至尚艺术会所</div>
                            <div class="yc">ART CLUB</div>
                        </a>
                    </li>
                    <li>
                        <a href="/activity" class="tn-n">
                            <div class="xs">活动优惠</div>
                            <div class="yc">ACTIVITY</div>
                        </a>
                    </li>
                    <li>
                        <a  {if isset($pp_link) && $pp_link !=='' } href="{$pp_link}" target="_blank" {else} href="/introduce"{/if} class="tn-n">
                        <div class="xs">品牌介绍</div>
                        <div class="yc">INTRODUCE</div>
                        </a>
                    </li>
                </ul>
            </div>
        </div>

        <h1 class="top-h1"><a href="/"><img src="/static/home/img/logo.jpg" alt=""></a></h1>
    </div>

    <div class="kz-nr" >
        <div class="kz-nr1">
            {volist name="hd" id="v"}
            <div class="kz-nr1-1">
                <a target="_blank" href="/activity/nr/id/{$v.id}"><img width="570" height="285" src="{$v.main_img}" alt=""></a>
                <div class="zx">新品</div>
            </div>
            {/volist}
        </div>
        <div class="kz-nr2" id="box">
            <div class="kz-nr2-main">
                <img class="kp" src="/static/home/img/每周客照欣赏.png" alt="">
                <div class="kz-nr2-main-1">

                    <ul class="nian">
                        <li class="year">
                            <div class="model-select-box">
                                <div class="model-select-text" id="max-month" data-value=""> {$data['ps_time']|date='Y',###}</div>
                                <ul class="model-select-option">
                                    {volist name="data_year"  id="v" key="k"}
                                    <li data-option="{$k}" {if isset($year) && $year == $v['nian']}  {/if} class="seleced">{$v['nian']}</li>
                                    {/volist}

                                </ul>
                            </div>
                            <img src="/static/home/img/下箭头.png" alt="">
                        </li>

                    </ul>
                    <ul id="momth-li" class="yue">
                        {volist name="month" id="v" key="k"}
                        <li {if isset($v['class'])}  onclick="getWorks(this,{$k})"  {/if} value="{$k}" class="{if isset($v['class'])}{$v['class']} {/if} {if date('m',$data['ps_time']) == $k } cur {/if}   "  data-id="{$k}"><a  href="javascript:;">{$v[0]}</a></li>
                        {/volist}
                    </ul>
                    <ul class="zhou">
                        {volist name="week" id="v" key="k"}
                        <li onclick="getWorks_(this,{$k})" data-id="{$k}" {if $data['zhou'] == $k}class="cur"{/if}>{$v}</li>
                        {/volist}

                    </ul>
                </div>
                <input id="month-val" value="{$data['ps_time']|date="n",###}" type="hidden">
                <div class="kz-nr2-main-2" id="duotu">
                    {if isset($data.imgurl)}
                    {volist name="data.imgurl" id="v"}
                    <div class="kz-nr2-main-2-1">
                        <img src="{$v.works_pic}" alt="">
                        <!--<a href="{$v.works_pic}" download="{$v.wjname}"><div class="xiazai">-->
                            <!--<img src="/static/home/img/xizai.png"/>-->
                        <!--</div></a>-->
                    </div>
                    {/volist}
                    {/if}
                </div>
                <div class="kz-nr2-main3-3">
                    {if isset($upId)}
                    <a href="/guest/mz/id/{$upId}"><div class="syz">
                        上一组
                    </div></a>
                    {else}
                        <div class="syx1">
                            上一组
                        </div>
                    {/if}
                    {if isset($downId)}
                    <a href="/guest/mz/id/{$downId}">
                        <div class="xyz">
                            下一组
                        </div>
                    </a>
                    {else}
                        <div class="syx2">
                            下一组
                        </div>
                    {/if}
                </div>
                <div class="kz-nr2-main3-4">
                    <p>所展示的作品均来自真实客人定制照片，并经由客户本人同意在阜阳塞纳皇宫唯一官方网站www.snhg.com.cn进行发表
                        原创作品，未经允许不得转载或用于任何商业用途，违者必究！</p>
                </div>
            </div>
        </div>
    </div>



    {include file="public/foot"}
    <script>
        var type=1;
        $(function(){
            /*
             * 模拟网页中所有的下拉列表select
             */

            function selectModel(){

                var $box = $('div.model-select-box');
                var $option = $('ul.model-select-option', $box);
                var $txt = $('div.model-select-text', $box);
                var speed = 10;
                /*
                 * 单击某个下拉列表时，显示当前下拉列表的下拉列表框
                 * 并隐藏页面中其他下拉列表
                 */
                $txt.click(function(e) {

                    $option.not($(this).siblings('ul.model-select-option')).slideUp(speed, function(){

                        int($(this));
                    });
                    $(this).siblings('ul.model-select-option').slideToggle(speed, function(){

                        int($(this));
                    });
                    return false;
                });
                //点击选择，关闭其他下拉
                /*
                 * 为每个下拉列表框中的选项设置默认选中标识 data-selected
                 * 点击下拉列表框中的选项时，将选项的 data-option 属性的属性值赋给下拉列表的 data-value 属性，并改变默认选中标识 data-selected
                 * 为选项添加 mouseover 事件
                 */
                $option.find('li').each(function(index, element) {
                    if($(this).hasClass('seleced')){
                        $(this).addClass('data-selected');
                    }
                })
                    .mousedown(function resgetmin(){
                        type=2;
                        $(".zhou li").removeClass('cur');
                        $(".zhou li").removeClass('wxz');
                        var year = $(this).html();
                        $.post('/index/changedate',{year:year},function(res){
                            if(res.code==1){
                                var html='';
                                var kz='';
                                for(i in res.data){
                                    var str ='';
                                    var shijian=''
                                    if(res.data[i]['class'] !== undefined){
                                        var month =parseInt(i)+1;
                                        str ='wxz';
                                        url ='javascript:;';
                                        shijian ='onclick="getWorks(this,'+month+')"'
                                        //url ='/index/guest/y/'+year+'/m/'+month+'';
                                    }else{
                                        str ='';
                                        var shijian=''
                                        url ='javascript:;';
                                    }
                                    html +='<li class="'+str+'" '+shijian+'>' +
                                        '<a href="'+url+'"  >'+res.data[i][0]+'</a>' +
                                        '</li>';
                                }
                                $('#momth-li').empty();
                                $('#momth-li').append(html);




                            }
                        })



                        $(this).parent().siblings('div.model-select-text').text($(this).text())
                            .attr('data-value', $(this).attr('data-option'));

                        $option.slideUp(speed, function(){
                            int($(this));
                        });
                        $(this).addClass('seleced data-selected').siblings('li').removeClass('seleced data-selected');
                        return false;
                    })
                    .mouseover(function(){
                        $(this).addClass('seleced').siblings('li').removeClass('seleced');
                    });
                //点击文档，隐藏所有下拉
                $(document).click(function(e) {
                    $option.slideUp(speed, function(){

                        int($(this));
                    });
                });
                //初始化默认选择
                function int(obj){
                    obj.find('li.data-selected').addClass('seleced').siblings('li').removeClass('seleced');
                }
            }

            selectModel();
        })

    function getWorks(obj,month) {

        year =$("#max-month").html();
        $('#momth-li li').removeClass('cur');
        getweekData(year,month);
        $('.zhou li').removeClass('cur');

        $(obj).addClass('cur');
        $("#month-val").val(month);
        type =2;
    }

    function getWorks_(obj,week){

        $(obj).addClass('cur');
        var month = $("#month-val").val();
        var year = $("#max-month").html();
        $.post('/guest/getworks_content',{week:week,month:month,year:year},function(res){
            if(res.code==1){
                window.location.href='/guest/mz/id/'+res.data.id+'';

            }else{
                $('#duotu').empty();
                $('#duotu').append('暂无数据');
            }


        })

    }

        $('html, body').animate({scrollTop: $('#box').offset().top}, 1000);
     //

        var year =$("#max-month").html();
       var month = $("#month-val").val();
            getweekData(year,month);
            function getweekData(year,month){

                //var year =$("#max-month").html();
                //var month = $("#month-val").val();


                var zhou  ='<?php  if(isset($data['zhou'])){ echo $data['zhou'];}?>';

                $.post('/guest/getweek',{year:year,month:month},function(res){
                    if(res.code==1){
                        var html='';
                        for(i in res.data){
                            var str ='';
                            var str_2 ='';
                            var shijian=''
                            var week =parseInt(i)+1;
                            if(res.data[i]['class'] !== undefined){

                                str ='wxz';
                                url ='javascript:;';
                                shijian ='onclick="getWorks_(this,'+week+')"'
                                //url ='/index/guest/y/'+year+'/m/'+month+'';
                            }else{
                                str ='';
                                var shijian=''
                                url ='javascript:;';
                            }

                            if(zhou == week && type==1){
                                str_2='cur';

                            }



                            html +='<li  '+shijian+' data-id="'+week+'" class="'+str+' '+str_2+'">'+res.data[i][0]+'</li>';
                        }
                        $('.zhou').empty();
                        $('.zhou').append(html);
                    }
                })
            }





    </script>
    </html>